package com.jishucai.webapp;

import com.jishucai.servlet.CustomHttpRequest;
import com.jishucai.servlet.CustomHttpResponse;
import com.jishucai.servlet.CustomServlet;

/**
 * @author qiaowang 2021/4/16
 */
public class SomeServlet extends CustomServlet {
    @Override
    public void doGet(CustomHttpRequest request, CustomHttpResponse response) throws Exception {
        String param = request.getParameter("name");
        String uri = request.getUri();
        String method = request.getMethod();
        String path = request.getPath();

        String content = "method = " + method + "\n"
                + "uri = " + uri + "\n"
                + "method = " + method + "\n"
                + "path = " + path;

        response.write(content);
    }

    @Override
    public void doPost(CustomHttpRequest request, CustomHttpResponse response) throws Exception {
        doGet(request, response);
    }
}
